#pragma once
#ifndef __G_EVENT_H__
#define __G_EVENT_H__

#include <string>

#include "GSynchronizer.h"
#include "GTypes.h"

namespace GThread
{
	class GEvent : public GWaitable
	{
	protected:
		void*			Event;

		std::string		Name;
		bool			ManualReset;

	public:
						GEvent();
						~GEvent();

		void*			GetHandle() const;

		const char*		GetName() const;
		bool			GetManualReset() const;

		bool			IsCreated() const;

		bool			Create(bool ManualReset, bool StartSignaled, const char* Name);
		void			Release();

		bool			Signal();
		bool			Reset();

		GWaitResult		WaitForSignal(GUInt32 TimeOut = G_TIMEOUT_INFINITE);

	};

}

#endif